import { Routes, Route, Navigate } from 'react-router-dom'
import Game1 from '../pages/Game/Game1'
import Home from '../pages/Common/Home'
import NotFound from '../pages/Common/NotFound'
import Test from '../pages/test/Test'
import Layout from '../pages/backend/Layout'
import Dashboard from '../pages/backend/Dashboard/index'
import UserList from '../pages/backend/User/list'

function AppRoutes() {
    return (
        <Routes>
            {/* 根路径重定向 */}
            <Route path="/" element={<Navigate to="/dashboard" replace />} />

            <Route path="/dashboard" element={<Layout> <Dashboard /></Layout>} />
            <Route path="/user/list" element={<Layout> <UserList /></Layout>} />

            {/* 其他路由 */}
            <Route path="/home" element={<Home />} />
            <Route path="/game1" element={<Game1 />} />
            <Route path="/test" element={<Test />} />

            {/* 404 */}
            <Route path="*" element={<NotFound />} />

        </Routes>
    )
}

export default AppRoutes
